package top.zhuyougu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import top.zhuyougu.utils.DateUtils;

/**
 * <p>
 * 系统管理-权限资源表 
 * </p>
 *
 * @author 猪油骨
 * @since 2022-12-10 01:15:43
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@TableName("b_menu")
@ApiModel(value = "Menu对象", description = "系统管理-权限资源表 ")
public class Menu implements Serializable {
    private static final long serialVersionUID=1L;
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("上级资源ID")
    @TableField("parent_id")
    private Integer parentId;

    @ApiModelProperty("url")
    @TableField("url")
    private String url;

    @ApiModelProperty("资源编码")
    @TableField("component")
    private String component;

    @ApiModelProperty("资源名称")
    @TableField("title")
    private String title;

    @ApiModelProperty("资源级别")
    @TableField("level")
    private Integer level;

    @ApiModelProperty("排序")
    @TableField("sort_no")
    private Integer sortNo;

    @ApiModelProperty("资源图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty("类型 menu、button")
    @TableField("type")
    private String type;

    @ApiModelProperty("备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty("创建时间")
    @TableField("created_time")
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private Date createdTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private Date updateTime;

    @ApiModelProperty("重定向地址")
    @TableField("redirect")
    private String redirect;

    @ApiModelProperty("资源名字")
    @TableField("name")
    private String name;

    @ApiModelProperty("是否隐藏")
    @TableField("hidden")
    private String hidden;

    @TableField(exist = false)
    private List<Menu> children;
}
